#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>
char* my_strncpy(char* dest, const char* sour, size_t num)
{
	assert(dest && sour);
	int i = 0, flag = 0;
	for (i = 0; i < num; i++)
	{
		if (sour[i] != '\0' && flag == 0)
		{
			dest[i] = sour[i];
		}
		else
		{
			flag = 1;
			dest[i] = '\0';
		}
	}

	return dest;
}
int main()
{
	char a[20] = "**********";
	char b[] = "abcdef";
	printf("%s", my_strncpy(a, b, 10));

	return 0;
}